<script>
/**
 * 商品属性排行
 * @Author Mumu xinglinhe@qq.com
 * @Date 2022/09/13
 */
export default{
	components:{},
	props:{},
	data(){
		return {
			field:[{
				title: '排名',
				dataIndex: 'name',
			}, {
				title: '名称',
				dataIndex: 'class',
			}],//表头
			list:[
				{
					id:1,
					name:'类型'
				},
				{
					id:2,
					name:'类型2'
				},
				{
					id:3,
					name:'类型3'
				},
				{
					id:4,
					name:'类型4'
				},
			],//列表
			listloading:false,
			search:{},
			activeKey:[],
		}
	},
	created(){},
	mounted(){
		this.getAttr();
		this.$nextTick(()=>{
			this.getList();
		})
	},
	methods:{
		async getList() {
			return;
			if(this.listloading) return;
			this.listloading		=	true;
			let rs	=	await this.muajax.fodfodList({
				...this.search,
				page:this.pagination.current,
				size:this.pagination.pageSize,
			});
			this.listloading		=	false;
			// if (rs.status!=200) return;
			if ( this.pagination.current == 1 ){
				this.records		=	[];
			}
			this.list=rs.data;
			this.pagination.total=rs.sum;
		},//列表
		getAttr(){
			this.list=[
				{
					id:1,
					name:'类型'
				},
				{
					id:2,
					name:'类型2'
				},
				{
					id:3,
					name:'类型3'
				},
				{
					id:4,
					name:'类型4'
				},
			];
		},//获取属性列表
		research(){
			this.pagination.current=1;
			this.getList();
		},//搜索重置
		cc(e){
			console.log('cc',e)
		}
	},
	computed:{},
	watch:{
		activeKey:{
			deep:true,
			handler:function(newVal,oldVal){
				console.log()
				// 打开时 把没获取的数据获取一下
			}
		}
	},
	filters:{},
}
</script>
<template>
	<a-card>
		<a-collapse v-model:activeKey="activeKey" @change="cc">
			<a-collapse-panel v-for="v in list" :key="v.id" :header="v.name+'排行'"  >
				<a-form layout="inline" class="text-center">
					<a-form-item label="搜索">
						<a-range-picker
							@change="data=>[search.doctimeStart,search.doctimeEnd]=data"
							format="YYYY/MM/DD"
							valueFormat="YYYY/MM/DD"
							:placeholder="['开始时间','结束时间']"
						/>
					</a-form-item>
					<a-form-item>
						<a-space>
							<a-button type="primary" @click="research()">搜索</a-button>
							<!-- <a-button type="default">重置</a-button> -->
						</a-space>
					</a-form-item>
				</a-form>
				<div class="mm-t-20 mm-b-15">
					<a-space>
						<!-- <a-button type="primary" @click="$refs.mod.show(true)">+ 新建</a-button> -->
						<!-- <a-button type="primary" danger>删除</a-button> -->
					</a-space>
				</div>
				<a-table
					:columns="field"
					:data-source="v.list"
					:pagination="false"
					:loading="listloading"
					:scrollToFirstRowOnChange="true"
					@change="page=>applysDataTableChangeHandle(page)"
					size="small"
					:row-key="(record)=>JSON.stringify(record)"
				></a-table>
			</a-collapse-panel>
		</a-collapse>


	</a-card>
</template>
<style lang="less" scoped>

</style>